<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/8/28
  Time: 16:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path = request.getContextPath(); %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.5.1.min.js"></script>
<style>
    #hide{
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
        position: fixed;
        background-image: url("<%=path%>/static/web/css/img/overlay.png");
        opacity: 1;
        z-index: 100;

    }
    #hide #mes{
        margin: 0;
        padding: 0;
        width: 50%;
        height: 70%;
        position: absolute;
        left: 25%;
        top: 15%;
        z-index: 120;
        border: #3a3a3a 8px solid;
        background-color: #cccccc;
    }
    #hide #mes #header{
        margin: 0;
        padding: 0;
        background-color:#019875;
        height: 50px;
        z-index: 150;
        color: white;
    }
    #hide #mes #header #but{
        position: relative;
        background-image: url("<%=path%>/static/web/css/img/controls.png");
        width: 30px;
        height: 30px;
        float: right;
        border:#019875 0px solid;
    }
    #hide #mes #header #but:hover{
        cursor: pointer;
    }
    #hide #mes #header #title{
        font-size: 25px;

    }
    #hide #mes div {
        margin-top: 10px;
        padding: 0;
        height: 50px;
        z-index: 150;
        color: #0C0C0C;
        font-size: 20px;
    }
    #images img{
        width: 80px;
        height: 80px;
        border-radius: 50%;
    }
    .city{
        width: 100px;
        height: 30px;
    }
    .job{
        height: 30px;
    }
    .money{
        height: 30px;
    }
    #education .describe{
        width: 200px;
        height: 100px;
        font-size:15px;
    }
    #button{
        position: absolute;
        top: 420px;


    }

</style>
<script>
    $(function () {
        $("#but").click(function () {
            $("#hide").css("display","none");
        });
    });
</script>
<div id="hide">
    <div id="mes">
        <div id="header">
            <span id="title">项目经验</span>
            <button id="but"></button>
        </div>
        <div class="dele">
        <div id="detailed">
            <span style="margin-left: 10px">项目名称:</span><input class="companyName" value="${itemEx.itemName}">
        </div>
        <div>
            <span style="margin-left: 10px">职位:</span><input class="jobName" value="${itemEx.job}">
        </div>
        <div id="education">
            开始年份:<input type="month"  class="timePeriod" value="${itemEx.timePeriod}">
            结束年份:<input type="month" class="endTimePeriod" value="${itemEx.endTimePeriod}"><br>
            自我描述:<input type="text" class="describe"  value="${itemEx.describe}" >
        </div>
        <div>

        </div>
        <div id="button">
            <button class="But">点击修改</button>
            <button class="delete" data-id="${itemEx.id}" style="float: right">点击删除</button>
        </div>
    </div>
    </div>
</div>

<script>
    $(function () {


        $(".But").click(function () {
            var id=${itemEx.id}
            var itemName=$(".companyName").val();
            var job=$(".jobName").val();
            var timePeriod=$(".timePeriod").val();
            var endTimePeriod=$(".endTimePeriod").val();
            var describe=$(".describe").val();


            $.ajax({
                url:path+"/zhuang/user/updateItemEx",
                type:"post",
                data:{"itemName":itemName,"job":job,"timePeriod":timePeriod,"endTimePeriod":endTimePeriod,"id":id,"describe":describe},
                success:function (data) {
                    alert("上传成功")

                }
            })
            location.href="${pageContext.request.contextPath}/zhuang/user/jianli";

        })
        $(".delete").click(function () {
            var id=$(this).data("id");



            $.ajax({
                url:path+"/zhuang/user/deleteItemEx",
                type:"post",
                data:{"id":id},
                success:function (data) {
                    $("#hide").css("display","none")


                }
            })
            location.href="${pageContext.request.contextPath}/zhuang/user/jianli";

        })

    })
</script>
